inst/solutions/chapter3/exercise 14 solutions/server.R

function(input, output) {
  output$scatter = renderPlot({
    an = movies[movies[input$movie_type] == 1, ]
    ggplot(an, aes(x = length)) +
      geom_histogram(fill = "steelblue") +
      labs(y = "Count",
           x = "Length",
           title = paste0(input$movie_type, " movies"))
  })
}
jr-packages/jrShiny documentation built on Feb. 16, 2020, 9:13 p.m.